﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace Stala
{
	class SimpleVersionInstaller : IVersionInstaller
	{
		Uri package;

		public SimpleVersionInstaller(Uri package)
		{
			this.package = package;
		}

		public void Install()
		{
			var installerLocation = @"msiexec.exe";
			var installerArguments = @"/i " + package.LocalPath + " Reinstall=All REINSTALLMODE=vomus";
			var processStartInfo = new ProcessStartInfo(installerLocation, installerArguments);
			var process = new Process();
			process.StartInfo = processStartInfo;
			process.Start();
		}

		public event Action NewVersionInstalled;
	}
}
